<!DOCTYPE html>
<html>
<head>
  <%- include('../partials/head') %>
</head>
<body>
<%- include('../partials/site-header') %>

<main>

  <% var dpages = pages.filter(p => p.draft !== true) %>
  <% var ipages = dpages.filter(p => p.index !== false) %>

  <% if (ipages.length > 0) { %>
    <% for (var page of ipages) { %>
      <div class="page">
        <div class="page-url">
          <a href="<%- page.url %>"><%- page.title %></a>
        </div>
        <% if (page.date) { %>
          <div class="page-date">
              <%- page.date %>
          </div>
        <% } %>
      </div>
    <% } %>
  <% } else { %>
    <h1>fuckerfucker's own static blog website</h1>
    <p>Visit the <a href="/admin">admin</a> panel to create your first post.</p>
  <% } %>

</main>

<%- include('../partials/site-footer') %>
</body>
</html>